#include "junix.h"
#include <boost/bind.hpp>

using namespace std;
using boost::bind;

bool gt(int a, int b) {
	return a>b;
}

int main(int argc, char **argv)
{
	const int size = 30000000; 
	srand(time(0));
	vector<int> V(size);
	generate(V.begin(), V.end(),
			bind(modulus<int>(), bind(rand), size));

	vector<int> V2(V);
	clock_t beg = clock();
	sort(V2.begin(),V2.end(),gt);
	cout<<"gt:     "<<clock()-beg<<endl;

	beg=clock();
	sort(V.begin(), V.end(), greater<int>());
	cout<<"greater:"<<clock()-beg<<endl;

}
